﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HA.Data
{
    /// <summary>
    /// 该类用于对应视图的顶部视图，前视图，右视图
    /// </summary>
    [Serializable]
    
    public class ProjectViewPort
    {
        ProjectViewType _viewType=ProjectViewType.TOP;

        public ProjectViewType ViewType
        {
            get { return _viewType; }
            set { _viewType = value; }
        }


        int _viewLayerIndex = 1;

        public int ViewLayerIndex
        {
            get { return _viewLayerIndex; }
        }
        int _viewFrontIndex = 1;

        public int ViewFrontIndex
        {
            get { return _viewFrontIndex; }
        }
        int _viewRightIndex = 1;

        public int ViewRightIndex
        {
            get { return _viewRightIndex; }
        }
        /// <summary>
        /// 索引从1开始
        /// </summary>
        public int Number
        {
            get
            {
                switch (_viewType)
                {
                    case ProjectViewType.TOP:
                        return _viewLayerIndex > 1 ? _viewLayerIndex : 1;
                    case ProjectViewType.FRONT:
                        return _viewFrontIndex > 1 ? _viewFrontIndex : 1;
                    case ProjectViewType.RIGHT:
                        return _viewRightIndex > 1 ? _viewRightIndex : 1;
                    default:
                        return 1;
                }
            }
            set
            {
                if (value <= 0) return;
                switch (_viewType)
                {
                    case ProjectViewType.TOP:
                        _viewLayerIndex = value;
                        break;
                    case ProjectViewType.FRONT:
                        _viewFrontIndex = value;
                        break;
                    case ProjectViewType.RIGHT:
                        _viewRightIndex = value;
                        break;
                    default:
                        return;
                }
            }
        }
    }
}
